home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / kcl.lha / uts / hasegawa / object.h < prev    next >
C/C++ Source or Header  |  1987-05-08  |  16KB  |  668 lines

  1. /*
  2. (C) Copyright Taiichi Yuasa and Masami Hagiya, 1984.  All rights reserved.
  3. */
  4.  
  5. /*
  6.     object.h
  7. */
  8.  
  9. /*
  10.     Some system constants.
  11. */
  12.  
  13. #define    TRUE        1    /*  boolean true value  */
  14. #define    FALSE        0    /*  boolean false value  */
  15.  
  16. #define    NBPP        4    /*  number of bytes per pointer  */
  17.  
  18. #define    PAGESIZE    2048    /*  page size in bytes  */
  19. #define    PAGEWIDTH    11    /*  page width  */
  20.                 /*  log2(PAGESIZE)  */
  21.  
  22. #define    CHCODELIM    256    /*  character code limit  */
  23.                 /*  ASCII character set  */
  24. #define    CHFONTLIM    1    /*  character font limit  */
  25. #define    CHBITSLIM    1    /*  character bits limit  */
  26. #define    CHCODEFLEN    8    /*  character code field length  */
  27. #define    CHFONTFLEN    0    /*  character font field length  */
  28. #define    CHBITSFLEN      0    /*  character bits field length  */
  29.  
  30. #define    PHTABSIZE    512    /*  number of entries  */
  31.                 /*  in the package hash table  */
  32.  
  33. #define    ARANKLIM    64    /*  array rank limit  */
  34.  
  35. #define    RTABSIZE    CHCODELIM
  36.                 /*  read table size  */
  37.  
  38. #define    CBMINSIZE    64    /*  contiguous block minimal size  */
  39.  
  40.  
  41. typedef int bool;
  42. typedef int fixnum;
  43. typedef float shortfloat;
  44. typedef double longfloat;
  45.  
  46. /*
  47.     Definition of the type of LISP objects.
  48. */
  49. typedef union lispunion *object;
  50.  
  51. /*
  52.     OBJect NULL value.
  53.     It should not coincide with any legal object value.
  54. */
  55. #define    OBJNULL        ((object)NULL)
  56.  
  57. /*
  58.     Definition of each implementation type.
  59. */
  60.  
  61. struct fixnum_struct {
  62.     short    t, m;
  63.     fixnum    FIXVAL;        /*  fixnum value  */
  64. };
  65. #define    fix(obje)    (obje)->FIX.FIXVAL
  66.  
  67. #define    SMALL_FIXNUM_LIMIT    1024
  68.  
  69. struct fixnum_struct small_fixnum_table[2*SMALL_FIXNUM_LIMIT];
  70.  
  71. #define    small_fixnum(i)  \
  72.     (object)(small_fixnum_table+SMALL_FIXNUM_LIMIT+(i))
  73.  
  74. struct shortfloat_struct {
  75.     short        t, m;
  76.     shortfloat    SFVAL;    /*  shortfloat value  */
  77. };
  78. #define    sf(obje)    (obje)->SF.SFVAL
  79.  
  80. struct longfloat_struct {
  81.     short        t, m;
  82.     longfloat    LFVAL;    /*  longfloat value  */
  83. };
  84. #define    lf(obje)    (obje)->LF.LFVAL
  85.  
  86. struct bignum {
  87.     short        t, m;
  88.     struct bignum   *big_cdr;    /*  bignum cdr  */
  89.     int        big_car;    /*  bignum car  */
  90. };
  91.  
  92. struct ratio {
  93.     short    t, m;
  94.     object    rat_den;    /*  denominator  */
  95.                 /*  must be an integer  */
  96.     object    rat_num;    /*  numerator  */
  97.                 /*  must be an integer  */
  98. };
  99.  
  100. struct complex {
  101.     short    t, m;
  102.     object    cmp_real;    /*  real part  */
  103.                 /*  must be a number  */
  104.     object    cmp_imag;    /*  imaginary part  */
  105.                 /*  must be a number  */
  106. };
  107.  
  108. struct character {
  109.     short        t, m;
  110.     unsigned short    ch_code;    /*  code  */
  111.     unsigned char    ch_font;    /*  font  */
  112.     unsigned char    ch_bits;    /*  bits  */
  113. };
  114.  
  115. #ifdef MV
  116.  
  117. #endif
  118.  
  119. #ifdef AV
  120. struct character character_table[];
  121. #endif
  122.  
  123. #define    code_char(c)        (object)(character_table+(c))
  124. #define    char_code(obje)        (obje)->ch.ch_code
  125. #define    char_font(obje)        (obje)->ch.ch_font
  126. #define    char_bits(obje)        (obje)->ch.ch_bits
  127.  
  128. enum stype {            /*  symbol type  */
  129.     stp_ordinary,        /*  ordinary  */
  130.     stp_constant,        /*  constant  */
  131.         stp_special        /*  special  */
  132. };
  133.  
  134. #define    Cnil            ((object)&Cnil_body)
  135. #define    Ct            ((object)&Ct_body)
  136.  
  137. struct symbol {
  138.     short    t, m;
  139.     object    s_dbind;    /*  dynamic binding  */
  140.     int    (*s_sfdef)();    /*  special form definition  */
  141.                 /*  This field coincides with c_car  */
  142.  
  143. #define    NOT_SPECIAL        ((int (*)())Cnil)
  144.  
  145. #define    s_fillp        st_fillp
  146. #define    s_self        st_self
  147.  
  148.     int    s_fillp;    /*  print name length  */
  149.     char    *s_self;    /*  print name  */
  150.                 /*  These fields coincide with  */
  151.                 /*  st_fillp and st_self.  */
  152.  
  153.     object    s_gfdef;        /*  global function definition  */
  154.                 /*  For a macro,  */
  155.                 /*  its expansion function  */
  156.                 /*  is to be stored.  */
  157.     object    s_plist;    /*  property list  */
  158.     object    s_hpack;    /*  home package  */
  159.                 /*  Cnil for uninterned symbols  */
  160.     short    s_stype;    /*  symbol type  */
  161.                 /*  of enum stype  */
  162.     short    s_mflag;    /*  macro flag  */
  163. };
  164.  
  165. struct symbol Cnil_body, Ct_body;
  166.  
  167. struct package {
  168.     short    t, m;
  169.     object    p_name;        /*  package name  */
  170.                 /*  a string  */
  171.     object    p_nicknames;    /*  nicknames  */
  172.                 /*  list of strings  */
  173.     object    p_shadowings;    /*  shadowing symbol list  */
  174.     object    p_uselist;    /*  use-list of packages  */
  175.     object    p_usedbylist;    /*  used-by-list of packages  */
  176.     object    *p_internal;    /*  hashtable for internal symbols  */
  177.     object    *p_external;    /*  hashtable for external symbols  */
  178.     struct package
  179.         *p_link;    /*  package link  */
  180. };
  181.  
  182. /*
  183.     The values returned by intern and find_symbol.
  184.     File_symbol may return 0.
  185. */
  186. #define    INTERNAL    1
  187. #define    EXTERNAL    2
  188. #define    INHERITED    3
  189.  
  190. /*
  191.     All the packages are linked through p_link.
  192. */
  193. struct package *pack_pointer;    /*  package pointer  */
  194.  
  195. struct cons {
  196.     short    t, m;
  197.     object    c_cdr;        /*  cdr  */
  198.     object    c_car;        /*  car  */
  199. };
  200.  
  201. enum httest {            /*  hash table key test function  */
  202.     htt_eq,            /*  eq  */
  203.     htt_eql,        /*  eql  */
  204.     htt_equal        /*  equal  */
  205. };
  206.  
  207. struct htent {            /*  hash table entry  */
  208.     object    hte_key;    /*  key  */
  209.     object    hte_value;    /*  value  */
  210. };
  211.  
  212. struct hashtable {        /*  hash table header  */
  213.     short    t, m;
  214.     struct htent
  215.         *ht_self;    /*  pointer to the hash table  */
  216.     object    ht_rhsize;    /*  rehash size  */
  217.     object    ht_rhthresh;    /*  rehash threshold  */
  218.     int    ht_nent;    /*  number of entries  */
  219.     int    ht_size;    /*  hash table size  */
  220.     short    ht_test;    /*  key test function  */
  221.                 /*  of enum httest  */
  222. };
  223.  
  224. enum aelttype {            /*  array element type  */
  225.     aet_object,        /*  t  */
  226.     aet_ch,            /*  string-char  */
  227.     aet_bit,        /*  bit  */
  228.     aet_fix,        /*  fixnum  */
  229.     aet_sf,            /*  short-float  */
  230.     aet_lf            /*  long-float  */
  231. };
  232.  
  233. struct array {            /*  array header  */
  234.     short    t, m;
  235.     short    a_rank;        /*  array rank  */
  236. /*    short    v_hasfillp;        has-fill-pointer flag  */
  237.     short    a_adjustable;    /*  adjustable flag  */
  238.     int    a_dim;        /*  dimension  */
  239.     int    *a_dims;    /*  table of dimensions  */
  240. /*    int    v_fillp;        fill pointer  */
  241.     object    *a_self;    /*  pointer to the array  */
  242.     object    a_displaced;    /*  displaced  */
  243.     short    a_elttype;    /*  element type  */
  244.     short    a_offset;    /*  bitvector offset  */
  245. };
  246.  
  247. struct vector {            /*  vector header  */
  248.     short    t, m;
  249.     short    v_hasfillp;    /*  has-fill-pointer flag  */
  250.     short    v_adjustable;    /*  adjustable flag  */
  251.     int    v_dim;        /*  dimension  */
  252.     int    v_fillp;    /*  fill pointer  */
  253.                 /*  For simple vectors,  */
  254.                 /*  v_fillp is equal to v_dim.  */
  255.     object    *v_self;    /*  pointer to the vector  */
  256.     object    v_displaced;    /*  displaced  */
  257.     short    v_elttype;    /*  element type  */
  258.     short    v_offset;    /*  not used  */
  259. };
  260.  
  261. struct string {            /*  string header  */
  262.     short    t, m;
  263.     short    st_hasfillp;    /*  has-fill-pointer flag  */
  264.     short    st_adjustable;    /*  adjustable flag  */
  265.     int    st_dim;        /*  dimension  */
  266.                 /*  string length  */
  267.     int    st_fillp;    /*  fill pointer  */
  268.                 /*  For simple strings,  */
  269.                 /*  st_fillp is equal to st_dim.  */
  270.     char    *st_self;    /*  pointer to the string  */
  271.     object    st_displaced;    /*  displaced  */
  272. };
  273.  
  274. struct ustring {
  275.     short    t, m;
  276.     short    ust_hasfillp;
  277.     short    ust_adjustable;
  278.     int    ust_dim;
  279.     int    ust_fillp;
  280.     unsigned char
  281.         *ust_self;
  282.     object    ust_displaced;
  283. };
  284.  
  285. struct bitvector {        /*  bitvector header  */
  286.     short    t, m;
  287.     short    bv_hasfillp;    /*  has-fill-pointer flag  */
  288.     short    bv_adjustable;    /*  adjustable flag  */
  289.     int    bv_dim;        /*  dimension  */
  290.                 /*  number of bits  */
  291.     int    bv_fillp;    /*  fill pointer  */
  292.                 /*  For simple bitvectors,  */
  293.                 /*  st_fillp is equal to st_dim.  */
  294.     char    *bv_self;    /*  pointer to the bitvector  */
  295.     object    bv_displaced;    /*  displaced  */
  296.     short    bv_elttype;    /*  not used  */
  297.     short    bv_offset;    /*  bitvector offset  */
  298.                 /*  the position of the first bit  */
  299.                 /*  in the first byte  */
  300. };
  301.  
  302. struct fixarray {        /*  fixnum array header  */
  303.     short    t, m;
  304.     short    fixa_rank;    /*  array rank  */
  305.     short    fixa_adjustable;/*  adjustable flag  */
  306.     int    fixa_dim;    /*  dimension  */
  307.     int    *fixa_dims;    /*  table of dimensions  */
  308.     fixnum    *fixa_self;    /*  pointer to the array  */
  309.     object    fixa_displaced;    /*  displaced  */
  310.     short    fixa_elttype;    /*  element type  */
  311.     short    fixa_offset;    /*  not used  */
  312. };
  313.  
  314. struct sfarray {        /*  short-float array header  */
  315.     short    t, m;
  316.     short    sfa_rank;    /*  array rank  */
  317.     short    sfa_adjustable;    /*  adjustable flag  */
  318.     int    sfa_dim;    /*  dimension  */
  319.     int    *sfa_dims;    /*  table of dimensions  */
  320.     shortfloat
  321.         *sfa_self;    /*  pointer to the array  */
  322.     object    sfa_displaced;    /*  displaced  */
  323.     short    sfa_elttype;    /*  element type  */
  324.     short    sfa_offset;    /*  not used  */
  325. };
  326.  
  327. struct lfarray {        /*  long-float array header  */
  328.     short    t, m;
  329.     short    lfa_rank;    /*  array rank  */
  330.     short    lfa_adjustable;    /*  adjustable flag  */
  331.     int    lfa_dim;        /*  dimension  */
  332.     int    *lfa_dims;    /*  table of dimensions  */
  333.     longfloat
  334.         *lfa_self;    /*  pointer to the array  */
  335.     object    lfa_displaced;    /*  displaced  */
  336.     short    lfa_elttype;    /*  element type  */
  337.     short    lfa_offset;    /*  not used  */
  338. };
  339.  
  340. struct structure {        /*  structure header  */
  341.     short    t, m;
  342.     object    str_name;    /*  structure name  */
  343.     object    *str_self;    /*  structure self  */
  344.     int    str_length;    /*  structure length  */
  345. };
  346.  
  347. enum smmode {            /*  stream mode  */
  348.     smm_input,        /*  input  */
  349.     smm_output,        /*  output  */
  350.     smm_io,            /*  input-output  */
  351.     smm_probe,        /*  probe  */
  352.     smm_synonym,        /*  synonym  */
  353.     smm_broadcast,        /*  broadcast  */
  354.     smm_concatenated,    /*  concatenated  */
  355.     smm_two_way,        /*  two way  */
  356.     smm_echo,        /*  echo  */
  357.     smm_string_input,    /*  string input  */
  358.     smm_string_output    /*  string output  */
  359. };
  360.  
  361. struct stream {
  362.     short    t, m;
  363.     FILE    *sm_fp;        /*  file pointer  */
  364.     object    sm_object0;    /*  some object  */
  365.     object    sm_object1;    /*  some object */
  366.     int    sm_int0;    /*  some int  */
  367.     int    sm_int1;    /*  some int  */
  368.     short    sm_mode;    /*  stream mode  */
  369.                 /*  of enum smmode  */
  370. };
  371.  
  372. #ifdef BSD
  373. #define    BASEFF        (char *)0xffffffff
  374. #endif
  375.  
  376. #ifdef ATT
  377. #define    BASEFF        (unsigned char *)0xffffffff
  378. #endif
  379.  
  380. #ifdef E15
  381. #define    BASEFF        (unsigned char *)0xffffffff
  382. #endif
  383.  
  384. #ifdef MV
  385.  
  386.  
  387. #endif
  388.  
  389. struct random {
  390.     short        t, m;
  391.     unsigned    rnd_value;    /*  random state value  */
  392. };
  393.  
  394. enum chattrib {            /*  character attribute  */
  395.     cat_whitespace,        /*  whitespace  */
  396.     cat_terminating,    /*  terminating macro  */
  397.     cat_non_terminating,    /*  non-terminating macro  */
  398.     cat_single_escape,    /*  single-escape  */
  399.     cat_multiple_escape,    /*  multiple-escape  */
  400.     cat_constituent        /*  constituent  */
  401. };
  402.  
  403. struct rtent {                /*  read table entry  */
  404.     enum chattrib    rte_chattrib;    /*  character attribute  */
  405.     object        rte_macro;    /*  macro function  */
  406.     object        *rte_dtab;    /*  pointer to the  */
  407.                     /*  dispatch table  */
  408.                     /*  NULL for  */
  409.                     /*  non-dispatching  */
  410.                     /*  macro character, or  */
  411.                     /*  non-macro character  */
  412. };
  413.  
  414. struct readtable {            /*  read table  */
  415.     short        t, m;
  416.     struct rtent    *rt_self;    /*  read table itself  */
  417. };
  418.  
  419. struct pathname {
  420.     short    t, m;
  421.     object    pn_host;    /*  host  */
  422.     object    pn_device;    /*  device  */
  423.     object    pn_directory;    /*  directory  */
  424.     object    pn_name;    /*  name  */
  425.     object    pn_type;    /*  type  */
  426.     object    pn_version;    /*  version  */
  427. };
  428.  
  429. struct cfun {            /*  compiled function header  */
  430.     short    t, m;
  431.     object    cf_name;    /*  compiled function name  */
  432.     int    (*cf_self)();    /*  entry address  */
  433.     object    cf_data;    /*  data the function uses  */
  434.                 /*  for GBC  */
  435.     char    *cf_start;    /*  start address of the code  */
  436.     int    cf_size;    /*  code size  */
  437. };
  438.  
  439. struct cclosure {        /*  compiled closure header  */
  440.     short    t, m;
  441.     object    cc_name;    /*  compiled closure name  */
  442.     int    (*cc_self)();    /*  entry address  */
  443.     object    cc_env;        /*  environment  */
  444.     object    cc_data;    /*  data the closure uses  */
  445.                 /*  for GBC  */
  446.     char    *cc_start;    /*  start address of the code  */
  447.     int    cc_size;    /*  code size  */
  448.     object    *cc_turbo;    /*  turbo charger */
  449. };
  450.  
  451. struct spice {
  452.     short    t, m;
  453.     int    spc_dummy;
  454. };
  455.  
  456. /*
  457.     dummy type
  458. */
  459. struct dummy {
  460.     short    t, m;
  461. };
  462.  
  463. /*
  464.     Definition of lispunion.
  465. */
  466. union lispunion {
  467.     struct fixnum_struct
  468.             FIX;    /*  fixnum  */
  469.     struct bignum    big;    /*  bignum  */
  470.     struct ratio    rat;    /*  ratio  */
  471.     struct shortfloat_struct
  472.             SF;    /*  short floating-point number  */
  473.     struct longfloat_struct
  474.             LF;    /*  long floating-point number  */
  475.     struct complex    cmp;    /*  complex number  */
  476.     struct character
  477.             ch;    /*  character  */
  478.     struct symbol    s;    /*  symbol  */
  479.     struct package    p;    /*  package  */
  480.     struct cons    c;    /*  cons  */
  481.     struct hashtable
  482.             ht;    /*  hash table  */
  483.     struct array    a;    /*  array  */
  484.     struct vector    v;    /*  vector  */
  485.     struct string    st;    /*  string  */
  486.     struct ustring    ust;
  487.     struct bitvector
  488.             bv;    /*  bit-vector  */
  489.     struct structure
  490.             str;    /*  structure  */
  491.     struct stream    sm;    /*  stream  */
  492.     struct random    rnd;    /*  random-states  */
  493.     struct readtable
  494.             rt;    /*  read table  */
  495.     struct pathname    pn;    /*  path name  */
  496.     struct cfun    cf;    /*  compiled function  */
  497.     struct cclosure    cc;    /*  compiled closure  */
  498.     struct spice    spc;    /*  spice  */
  499.  
  500.     struct dummy    d;    /*  dummy  */
  501.  
  502.     struct fixarray    fixa;    /*  fixnum array  */
  503.     struct sfarray    sfa;    /*  short-float array  */
  504.     struct lfarray    lfa;    /*  long-float array  */
  505. };
  506.  
  507. /*
  508.     The struct of free lists.
  509. */
  510. struct freelist {
  511.     short    t, m;
  512.     object    f_link;
  513. };
  514.  
  515. #define    FREE    (-1)        /*  free object  */
  516.  
  517. /*
  518.     Implementation types.
  519. */
  520. enum type {
  521.     t_cons = 0,
  522.     t_start = t_cons,
  523.     t_fixnum,
  524.     t_bignum,
  525.     t_ratio,
  526.     t_shortfloat,
  527.     t_longfloat,
  528.     t_complex,
  529.     t_character,
  530.     t_symbol,
  531.     t_package,
  532. /*    t_cons,  */
  533.     t_hashtable,
  534.     t_array,
  535.     t_vector,
  536.     t_string,
  537.     t_bitvector,
  538.     t_structure,
  539.     t_stream,
  540.     t_random,
  541.     t_readtable,
  542.     t_pathname,
  543.     t_cfun,
  544.     t_cclosure,
  545.     t_spice,
  546.     t_end,
  547.     t_contiguous,        /*  contiguous block  */
  548.     t_relocatable,        /*  relocatable block  */
  549.     t_other            /*  other  */
  550. };
  551.  
  552. /*
  553.     Type map.
  554.  
  555.     enum type type_map[MAXPAGE];
  556. */
  557. char type_map[MAXPAGE];
  558.  
  559. /*
  560.     Type_of.
  561. */
  562. #define    type_of(obje)    ((enum type)(((object)(obje))->d.t))
  563.  
  564. /*
  565.     Storage manager for each type.
  566. */
  567. struct typemanager {
  568.     enum type
  569.         tm_type;    /*  type  */
  570.     int    tm_size;    /*  element size in bytes  */
  571.     int    tm_nppage;    /*  number per page  */
  572.     object    tm_free;    /*  free list  */
  573.                 /*  Note that it is of type object.  */
  574.     int    tm_nfree;    /*  number of free elements  */
  575.     int    tm_nused;    /*  number of elements used  */
  576.     int    tm_npage;    /*  number of pages  */
  577.     int    tm_maxpage;    /*  maximum number of pages  */
  578.     char    *tm_name;    /*  type name  */
  579.     int    tm_gbccount;    /*  GBC count  */
  580. };
  581.  
  582. /*
  583.     The table of type managers.
  584. */
  585. struct typemanager tm_table[(int)t_end];
  586.  
  587. #define    tm_of(t)    (&(tm_table[(int)tm_table[(int)(t)].tm_type]))
  588.  
  589. /*
  590.     Contiguous block header.
  591. */
  592. struct contblock {        /*  contiguous block header  */
  593.     int    cb_size;    /*  size in bytes  */
  594.     struct contblock
  595.         *cb_link;    /*  contiguous block link  */
  596. };
  597.  
  598. /*
  599.     The pointer to the contiguous blocks.
  600. */
  601. struct contblock *cb_pointer;    /*  contblock pointer  */
  602.  
  603. /*
  604.     Variables for memory management.
  605. */
  606. int ncb;            /*  number of contblocks  */
  607. int ncbpage;            /*  number of contblock pages  */
  608. int maxcbpage;            /*  maximum number of contblock pages  */
  609. int cbgbccount;            /*  contblock gbc count  */
  610.  
  611. int holepage;            /*  hole pages  */
  612. int nrbpage;            /*  number of relblock pages  */
  613. int rbgbccount;            /*  relblock gbc count  */
  614.  
  615. char *rb_start;            /*  relblock start  */
  616. char *rb_end;            /*  relblock end  */
  617. char *rb_limit;            /*  relblock limit  */
  618. char *rb_pointer;        /*  relblock pointer  */
  619. char *rb_start1;        /*  relblock start in copy space  */
  620. char *rb_pointer1;        /*  relblock pointer in copy space  */
  621.  
  622. char *heap_end;            /*  heap end  */
  623. char *core_end;            /*  core end  */
  624.  
  625. #define    HOLEPAGE    128
  626.  
  627. #ifdef ATT
  628. #undef HOLEPAGE
  629. #define    HOLEPAGE    32
  630. #endif
  631.  
  632. #ifdef E15
  633. #undef HOLEPAGE
  634. #define    HOLEPAGE    32
  635. #endif
  636.  
  637. #define    INIT_HOLEPAGE    150
  638. #define    INIT_NRBPAGE    50
  639. #define    RB_GETA        512
  640.  
  641. /*
  642.     Endp macro.
  643. */
  644. /*
  645. #define    endp(obje)    ((enum type)((endp_temp = (obje))->d.t) == t_cons ? \
  646.              FALSE : endp_temp == Cnil ? TRUE : \
  647.              (bool)FEwrong_type_argument(Slist, endp_temp))
  648.  
  649. object endp_temp;
  650. */
  651.  
  652. #define    endp(obje)    endp1(obje)
  653.  
  654. #ifdef AV
  655. #define    STATIC    register
  656. #endif
  657. #ifdef MV
  658.  
  659. #endif
  660.  
  661. #define    TIME_ZONE    (-9)
  662.  
  663. int FIXtemp;
  664.  
  665. #define    isUpper(xxx)    (((xxx)&0200) == 0 && isupper(xxx))
  666. #define    isLower(xxx)    (((xxx)&0200) == 0 && islower(xxx))
  667. #define    isDigit(xxx)    (((xxx)&0200) == 0 && isdigit(xxx))
  668.